Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply fallback content to frontpage. #38

Closed
wants to merge 1 commit into from
Closed

Apply fallback content to frontpage. #38

wants to merge 1 commit into from

Conversation

hofmannsven
Copy link
Collaborator

This pull request introduces a new filter (wpberlin/website/front_page_no_events) that gets applied in the template front-page.php so that the title and the content from this page are displayed if there are no valid events. The content for this page can be found in content/home.md.

Furthermore I renamed the action hook wpberlin/website/front_page to wpberlin/website/front_page_events and added a new SCSS element (elements/card).

@hofmannsven hofmannsven changed the title Applied content as fallback to frontpage. Closes #14 Applied content as fallback to frontpage. Jun 24, 2018
@hofmannsven hofmannsven changed the title Applied content as fallback to frontpage. Apply content as fallback to frontpage. Jun 24, 2018
@hofmannsven hofmannsven changed the title Apply content as fallback to frontpage. Apply fallback content to frontpage. Jun 24, 2018
Copy link
Member

@alpipego alpipego left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of the generic, utility classes .card and .info, I prefer to have semantic namespaced classes/CSS.

If (and better when) the declarations of .card will be reused. It should be declared as a mixin.

Until then I prefer to have the declaration in the element it applies to.

@@ -28,11 +28,30 @@
);
$provider = new CachedProvider($provider);

// Display `the_content` only if there are no valid events.
add_filter('wpberlin/website/front_page_no_events', function ($title, $content) use ($provider) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this filter (as well as the one below), should be put into the theme instead of the plugin. Instead of coupling the theme to the plugin, we should add the plugin as a dependency to the theme (cf. #41)

@alpipego alpipego changed the base branch from master to feature/homepage-fallback June 25, 2018 08:34
@hofmannsven
Copy link
Collaborator Author

@alpipego Thank you very much for your review.

I will submit another pull request as outlined in #39.

@hofmannsven hofmannsven deleted the homepage branch June 27, 2018 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants